<?php echo $header ?>
<?php echo $slider ?>
<div class="content">
    <div class="container">
        <div class="row">
            <div class="span8">
                <?php
                $mainPhoto = base_url() . "uploads/" . $item->photo;
                ?>
                <div class="row">
                    <div class="span8">
                        <div class="row">
                            <div class="span8">
                                <h2 class="single-title"><a href="<?php echo site_url() . "single/" . $estate->id; ?>"><?php echo $estate->title ?></a></h2>
                            </div>
                        </div>

                        <div class = "row">
                            <div class = "span8">

                                <link href="<?php echo base_url() ?>assets/theme/js/pikachoose/styles/bottom.css" rel="stylesheet" />
                                <script src="<?php echo base_url() ?>assets/theme/js/pikachoose/lib/jquery.jcarousel.min.js"></script>
                                <script src="<?php echo base_url() ?>assets/theme/js/pikachoose/lib/jquery.pikachoose.min.js"></script>

                                <?php $images = json_decode($estate->photoGallery); ?>
                                <div class="pikachoose">
                                    <ul id="pikame" class="jcarousel-skin-pika">
                                        <?php foreach ($images as $image) { ?>
                                            <li><img src="<?php echo base_url() . "uploads/" . $image ?>"/><span></li>
                                        <?php } ?>
                                    </ul>
                                </div>

                                <script language="javascript">
                                    $(document).ready(
                                        function() {
                                            $("#pikame").PikaChoose({
                                                carousel: true,
                                                text: {previous: "", next: "" },
                                                showCaption:false
                                            });
                                        });
                                </script>

                            </div>
                        </div>

                    </div>
                </div>
                <div class="row">
                    <div class="span8">      
                        <table class="table well singletable">
                            <tbody>
                                <tr>
                                    <td><?php echo lang('content_fprice') ?></td>
                                    <td><?php echo number_format($estate->price, 0, ".", ","); ?></td>
                                    <td><?php echo lang('single_date') ?></td>
                                    <td><?php echo date("d F Y", strtotime($estate->addedDate)) ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo lang('content_heating') ?></td>
                                    <td><?php echo $estate->heating ?></td>
                                    <td><?php echo lang('content_bathroom') ?></td>
                                    <td><?php echo $estate->bathroom ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo lang('content_buildstatus') ?></td>
                                    <td><?php echo $estate->buildstatus ?></td>
                                    <td><?php echo lang('content_room') ?></td>
                                    <td><?php echo $estate->room ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo lang('content_estate_type') ?></td>
                                    <td><?php echo $estate->estateName ?></td>
                                    <td><?php echo lang('content_estate_floor') ?></td>
                                    <td><?php echo $estate->floor ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo lang('content_squaremeter') ?></td>
                                    <td><?php echo $estate->squaremeter ?></td>
                                    <td><?php echo lang('content_category') ?></td>
                                    <td><?php echo $estate->catName ?></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="row">
                    <div class="span8">      
                        <?php echo $estate->content; ?>
                    </div>
                </div>
                <div class="row">
                    <div class="span8">      
                        <div class="well properties">
                            <?php
                            $one = TRUE;
                            $two = TRUE;
                            $three = TRUE;
                            ?>
                            <?php foreach ($properties as $key => $prop) { ?>
                                <?php
                                if ($prop->typeID == 1 and $one == TRUE) {
                                    echo "<h4>" . lang("single_hardware") . "</h4><hr/>";
                                    $one = FALSE;
                                }
                                ?>
                                <?php
                                if ($prop->typeID == 2 and $two == TRUE) {
                                    echo "<p></p><h4>" . lang("single_out_hardware") . "</h4><hr/>";
                                    $two = FALSE;
                                }
                                ?>
                                <?php
                                if ($prop->typeID == 3 and $three == TRUE) {
                                    echo "<p></p><h4>" . lang("single_envirenment") . "</h4><hr/>";
                                    $three = FALSE;
                                }
                                ?>
                                <label><i class="<?php echo ($prop->value) ? "icon-check" : "icon-check-empty" ?>"></i><?php echo $prop->name ?></label>
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="span4 sidebar">
                <?php echo $sidebar ?>
            </div>
        </div> <!-- Blog Row Finally -->
    </div>

    <?php if ($estates[0]->telephone) { ?>
        <div class="span4 well support">
            <h4><?php echo lang('single_contact') ?></h4>
            <hr/>
            <div class="row">
                <div class="span4">	
                    <div class="row">
                        <div class="span1"><i class="icon-phone"></i></div>
                        <div class="span3"><?php echo $estates[0]->telephone ?></div>
                    </div>
                </div>	
                <div class="span4">	
                    <div class="row">
                        <div class="span1"><i class="icon-mobile-phone"></i></div>
                        <div class="span3"><?php echo $estates[0]->gsm ?></div>
                    </div>
                </div>	
                <div class="span4">	
                    <div class="row">
                        <div class="span1"><i class="icon-envelope"></i></div>
                        <div class="span3"><?php echo $estates[0]->email ?></div>
                    </div>
                </div>	
            </div>
        </div>
    <?php } ?>

</div><!-- End Row--->

</div>
</div>


<?php echo $footer ?>